const webpack = require('webpack');
const { resolve } = require('path');
const merge = require('webpack-merge');
const common = require('./webpack.common.js')

module.exports = merge(common, {
	devtool: 'inline-source-map',
	entry: ['react-hot-loader/patch',
		'webpack-dev-server/client?https://localhost:9001',
		'webpack/hot/only-dev-server'],
	plugins: [
		new webpack.HotModuleReplacementPlugin(),
		new webpack.NamedModulesPlugin(),
	],
	devServer: {
		hot: true,
		contentBase: resolve(__dirname, 'dist'),
		publicPath: '/',
		port: 9001,
		disableHostCheck: true,
		headers: {
	        'Access-Control-Allow-Origin': '*'
	    }
	},
});